#include "globals.h"
namespace gl {

AudioPorts::AudioPorts() :
    nIns(0), nOuts(0), inputs(NULL), outputs(NULL), size(0){}

AudioPorts::AudioPorts(int ins, int outs, size_t buf_size) :
    nIns(ins), nOuts(ins),  size(buf_size) {
    inputs = new gl::PcmSampleType* [ins];
    outputs = new gl::PcmSampleType* [outs];
    for (int i=0; i< ins; ++i) inputs[i] = new gl::PcmSampleType [buf_size];
    for (int i=0; i< outs; ++i) outputs[i] = new gl::PcmSampleType [buf_size];
}

AudioPorts::~AudioPorts(){
    for (int i=0; i< nIns; ++i) delete [] inputs[i];
    for (int i=0; i< nOuts; ++i) delete [] outputs[i];
    delete [] inputs;
    delete [] outputs;
}

}
